/*     */ package com.lmpop.trade.ti_aboutchannel;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_aboutchannelInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_aboutchannelInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_aboutchannel ti_aboutchannel = new Ti_aboutchannel();
/*  26 */     ti_aboutchannel.setCh_id(map.getString("ch_id"));
/*  27 */     ti_aboutchannel.setCh_name(map.getString("ch_name"));
/*  28 */     ti_aboutchannel.setCh_level(map.getString("ch_level"));
/*  29 */     ti_aboutchannel.setUp_ch_id(map.getString("up_ch_id"));
/*  30 */     ti_aboutchannel.setOrder_no(map.getInt("order_no"));
/*  31 */     ti_aboutchannel.setState(map.getString("state"));
/*  32 */     ti_aboutchannel.setCh_type(map.getString("ch_type"));
/*  33 */     ti_aboutchannel.setUser_id(map.getString("user_id"));
/*     */ 
/*  35 */     String result_code = "0";
/*     */     try {
/*  37 */       insert(dbmMgr, ti_aboutchannel);
/*     */     } catch (ApplicationException e) {
/*  39 */       e.printStackTrace();
/*  40 */       result_code = "1";
/*     */     }
/*  42 */     map.setString("result_code", result_code);
/*  43 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_aboutchannel ti_aboutchannel)
/*     */     throws ApplicationException
/*     */   {
/*  52 */     dbmMgr.update("insertTi_aboutchannel", ti_aboutchannel);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  62 */     String pkid_string = map.getString("pkid");
/*  63 */     String result_code = "0";
/*     */     try {
/*  65 */       if (!pkid_string.equals("")) {
/*  66 */         String[] pkStr = pkid_string.split("\\|");
/*  67 */         for (int i = 0; i < pkStr.length; i++) {
/*  68 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  72 */       e.printStackTrace();
/*  73 */       result_code = "1";
/*     */     }
/*  75 */     map.setString("result_code", result_code);
/*  76 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  85 */     dbmMgr.update("deleteTi_aboutchannel", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  94 */     Ti_aboutchannel ti_aboutchannel = new Ti_aboutchannel();
/*  95 */     ti_aboutchannel.setCh_id(map.getString("ch_id"));
/*  96 */     ti_aboutchannel.setCh_name(map.getString("ch_name"));
/*  97 */     ti_aboutchannel.setCh_level(map.getString("ch_level"));
/*  98 */     ti_aboutchannel.setUp_ch_id(map.getString("up_ch_id"));
/*  99 */     ti_aboutchannel.setOrder_no(map.getInt("order_no"));
/* 100 */     ti_aboutchannel.setState(map.getString("state"));
/* 101 */     ti_aboutchannel.setCh_type(map.getString("ch_type"));
/* 102 */     ti_aboutchannel.setUser_id(map.getString("user_id"));
/*     */ 
/* 104 */     String result_code = "0";
/*     */     try {
/* 106 */       update(dbmMgr, ti_aboutchannel);
/*     */     } catch (ApplicationException e) {
/* 108 */       e.printStackTrace();
/* 109 */       result_code = "1";
/*     */     }
/* 111 */     map.setString("result_code", result_code);
/* 112 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_aboutchannel ti_aboutchannel)
/*     */     throws ApplicationException
/*     */   {
/* 121 */     dbmMgr.update("updateTi_aboutchannel", ti_aboutchannel);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 131 */     Ti_aboutchannel ti_aboutchannel = (Ti_aboutchannel)obj;
/* 132 */     if (start == 0)
/* 133 */       start = 0;
/*     */     else {
/* 135 */       start = (start - 1) * limit;
/*     */     }
/*     */ 
/* 138 */     ti_aboutchannel.setStart(Integer.valueOf(start));
/* 139 */     ti_aboutchannel.setLimit(Integer.valueOf(limit));
/*     */ 
/* 141 */     return this.queryList.getList("getListByTi_aboutchannelPage", ti_aboutchannel);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 152 */     Ti_aboutchannel ti_aboutchannel = (Ti_aboutchannel)obj;
/* 153 */     List list = this.queryList.getList("getCountByObjTi_aboutchannel", ti_aboutchannel);
/*     */ 
/* 155 */     int count = 0;
/* 156 */     if ((list != null) && (list.size() > 0)) {
/* 157 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 158 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 159 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 162 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 172 */     return this.queryList.getList("getTi_aboutchannelByPk", pk);
/*     */   }
/*     */ 
/*     */   public String getChName(String ch_id)
/*     */   {
/* 186 */     String ch_name = "";
/* 187 */     List namelist = this.queryList.getList("getTi_aboutchannelName", ch_id);
/* 188 */     if ((namelist != null) && (namelist.size() > 0)) {
/* 189 */       Hashtable map = (Hashtable)namelist.get(0);
/* 190 */       if (map.get("ch_name") != null)
/* 191 */         ch_name = map.get("ch_name").toString();
/*     */     }
/* 193 */     return ch_name;
/*     */   }
/*     */ 
/*     */   public int checkChild(String ch_id)
/*     */   {
/* 204 */     int child = 0;
/* 205 */     List childlist = this.queryList.getList("getTi_aboutchannelChild", ch_id);
/* 206 */     if ((childlist != null) && (childlist.size() > 0)) child = 1;
/* 207 */     return child;
/*     */   }
/*     */ 
/*     */   public String getUpChannelLevel(String ch_id)
/*     */   {
/* 217 */     String ch_level = "";
/* 218 */     List Idlist = this.queryList.getList("getSSUpChannelLevel", ch_id);
/* 219 */     if ((Idlist != null) && (Idlist.size() > 0)) {
/* 220 */       Map map = (Hashtable)Idlist.get(0);
/* 221 */       if (map.get("ch_level") != null)
/* 222 */         ch_level = map.get("ch_level").toString();
/*     */     }
/* 224 */     return ch_level;
/*     */   }
/*     */ 
/*     */   public String getSelfChannelLevel(String ch_id)
/*     */   {
/* 234 */     String ch_level = "";
/* 235 */     List Idlist = this.queryList.getList("getQQSelfChannelLevel", ch_id);
/* 236 */     Map map = (Hashtable)Idlist.get(0);
/* 237 */     if (map.get("ch_level") != null)
/* 238 */       ch_level = map.get("ch_level").toString();
/* 239 */     return ch_level;
/*     */   }
/*     */ 
/*     */   public String getUp_ch_id(String ch_id)
/*     */   {
/* 249 */     String up_ch_id = "";
/* 250 */     List Idlist = this.queryList.getList("getAboutUp_ch_id", ch_id);
/* 251 */     if ((Idlist != null) && (Idlist.size() > 0)) {
/* 252 */       Map chmap = (Hashtable)Idlist.get(0);
/* 253 */       if (chmap.get("up_ch_id") != null)
/*     */       {
/* 255 */         up_ch_id = chmap.get("up_ch_id").toString();
/*     */       }
/*     */     }
/* 258 */     return up_ch_id;
/*     */   }
/*     */ 
/*     */   public String getSelaboutChannelByLevel(String level)
/*     */   {
/* 267 */     Ti_aboutchannel ti_aboutchannel = new Ti_aboutchannel();
/* 268 */     String select = "";
/* 269 */     ti_aboutchannel.setCh_level(level);
/* 270 */     List list = this.queryList.getList("getSelaboutChannelByLevel", ti_aboutchannel);
/* 271 */     if ((list != null) && (list.size() > 0)) {
/* 272 */       for (int i = 0; i < list.size(); i++) {
/* 273 */         Hashtable map = (Hashtable)list.get(i);
/* 274 */         String id = ""; String text = "";
/* 275 */         if (map.get("ch_id") != null) {
/* 276 */           id = map.get("ch_id").toString();
/*     */         }
/* 278 */         if (map.get("ch_name") != null) {
/* 279 */           text = map.get("ch_name").toString();
/*     */         }
/* 281 */         select = select + "<option value=" + id + ">" + text + "</option>";
/*     */       }
/*     */     }
/* 284 */     return select;
/*     */   }
/*     */ 
/*     */   public Map getAbClassByUpId(String upclass)
/*     */   {
/* 293 */     Ti_aboutchannel ti_aboutchannel = new Ti_aboutchannel();
/* 294 */     ti_aboutchannel.setUp_ch_id(upclass);
/* 295 */     Map classMap = new Hashtable();
/* 296 */     String class_id = ""; String class_name = "";
/* 297 */     List list = this.queryList.getList("getAbClassByUpId", ti_aboutchannel);
/* 298 */     if ((list != null) && (list.size() > 0)) {
/* 299 */       for (int i = 0; i < list.size(); i++) {
/* 300 */         Hashtable map = (Hashtable)list.get(i);
/* 301 */         if (map.get("ch_name") != null) {
/* 302 */           class_name = map.get("ch_name").toString();
/*     */         }
/* 304 */         if (map.get("ch_id") != null) {
/* 305 */           class_id = map.get("ch_id").toString();
/*     */         }
/*     */ 
/* 308 */         classMap.put(class_id, class_name);
/*     */       }
/*     */     }
/* 311 */     return classMap;
/*     */   }
/*     */ 
/*     */   public int getCountByLevel(String ch_level)
/*     */   {
/* 321 */     List list = this.queryList.getList("getCountByLevel", ch_level);
/* 322 */     return list.size();
/*     */   }
/*     */ 
/*     */   public List getListAbClassByUpId(String upclass)
/*     */   {
/* 332 */     Ti_aboutchannel ti_aboutchannel = new Ti_aboutchannel();
/* 333 */     ti_aboutchannel.setUp_ch_id(upclass);
/* 334 */     List list = this.queryList.getList("getAbClassByUpId", ti_aboutchannel);
/*     */ 
/* 336 */     return list;
/*     */   }
/*     */ 
/*     */   public String getUpCh_IdByChId(String ch_id)
/*     */   {
/* 348 */     List list = this.queryList.getList("getUpCh_IdByChId", ch_id);
/* 349 */     String up_ch_id = "";
/* 350 */     if ((list != null) && (list.size() > 0)) {
/* 351 */       Hashtable upmap = new Hashtable();
/* 352 */       upmap = (Hashtable)list.get(0);
/* 353 */       if (upmap.get("up_ch_id") != null) up_ch_id = upmap.get("up_ch_id").toString();
/*     */     }
/* 355 */     return up_ch_id;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_aboutchannel.Ti_aboutchannelInfo
 * JD-Core Version:    0.6.0
 */